// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   QNA5B24.java

package org.quickserver.net.GB268753QN.control;

import java.text.SimpleDateFormat;
import java.util.*;
import org.quickserver.net.model.*;
import org.quickserver.net.server.ClientHandler;
import org.quickserver.util.data.dataProcessing;
import org.quickserver.util.state.QNA2B24State;

public class QNA5B24
{

    public QNA5B24()
    {
    }

    public static void QNA5B24OBJ(ClientHandler handler, String strs[], String serialNumber)
    {
        GBServerData ec = (GBServerData)handler.getClientData();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        int total = dataProcessing.hexStringToInt10(strs[1]);
        List Glist = new ArrayList();
        for(int i = 0; i < total; i++)
        {
            int fors = i * 8;
            String stateTime[] = new String[6];
            stateTime[0] = strs[4 + fors];
            stateTime[1] = strs[5 + fors];
            stateTime[2] = strs[6 + fors];
            stateTime[3] = strs[7 + fors];
            stateTime[4] = strs[8 + fors];
            stateTime[5] = strs[9 + fors];
            String componentState[] = new String[1];
            componentState[0] = strs[2 + fors];
            GB268753QN GBQN = new GB268753QN();
            GBQN.setId(ec.getUniqueCode());
            GBQN.setUniqueCode(ec.getUniqueCode());
            GBQN.setUploadTime(sdf.format(new Date()));
            GBQN.setStateTime(dataProcessing.strsToTime(stateTime));
            GBQN.setSysType("");
            GBQN.setComponentType("");
            GBQN.setIsComponent("1");
            GBQN.setComponentStateMap(QNA2B24State.getQNA2B24State(componentState));
            GBQN.setSysAddress("");
            GBQN.setLoopNumber("");
            GBQN.setComponentNumber("");
            GBQN.setTwiceCode("");
            Glist.add(GBQN);
        }

        Map map = new HashMap();
        map.put("GBQN", Glist);
        List list = ec.getSerialNumberList();
        for(int i = 0; i < list.size(); i++)
        {
            GB26875SetUp gs = (GB26875SetUp)list.get(i);
            if(!gs.getSerialNumber().equals(serialNumber))
                continue;
            ((GB26875SetUp)list.get(i)).setTrue(true);
            ((GB26875SetUp)list.get(i)).setOk(true);
            ((GB26875SetUp)list.get(i)).setDataMap(map);
            break;
        }

    }
}
